<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=0.4"/>
<meta name="google" content="notranslate" />
<link rel="canonical" href="https://sleef.org/quad.xhtml" />
<link rel="icon" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="texlike.css"/>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Ubuntu" />
<link rel="stylesheet" type="text/css" href="sleef.css"/>
<title>SLEEF - Quad-precision math library reference</title>
</head>
<body translate="no" class="notranslate">
<h1>SLEEF - Quad-precision math library reference</h1>

<h2>Table of contents</h2>

<ul class="none" style="font-family: arial, sansserif; padding-left: 0.5cm;">
  <li><a class="underlined" href="index.xhtml">Introduction</a></li>
  <li><a class="underlined" href="compile.xhtml">Compiling and installing the library</a></li>
  <li><a class="underlined" href="purec.xhtml">Math library reference</a></li>
  <li>&nbsp;</li>
  <li><a class="underlined" href="quad.xhtml"> Quad-precision math library reference</a>
  <ul class="disc">
    <li><a class="underlined" href="quad.xhtml">Data types and functions for all architectures</a></li>
    <ul class="circle">
      <li><a href="#introduction">Introduction</a></li>
      <li><a href="#datatypes">Data types</a></li>
      <li><a href="#macro">Convenience macros and constants</a></li>
      <li><a href="#conversion">Conversion and output functions</a></li>
      <li><a href="#comparison">Comparison functions</a></li>
      <li><a href="#mathfunctions">Math functions</a></li>
      <li><a href="#tutorial">Tutorial</a></li>
    </ul>
    <li><a class="underlined" href="quadx86.xhtml">Data types and functions for x86 architecture</a></li>
    <li><a class="underlined" href="quadaarch64.xhtml">Data types and functions for AArch64 architecture</a></li>
    <li><a class="underlined" href="quadppc64.xhtml">Data types and functions for PPC64 architecture</a></li>
    <li><a class="underlined" href="quads390x.xhtml">Data types and functions for System/390 architecture</a></li>
    <li><a class="underlined" href="quadcuda.xhtml">Data types and functions for CUDA</a></li>
  </ul>
  </li>
  <li>&nbsp;</li>
  <li><a class="underlined" href="dft.xhtml">DFT library reference</a></li>
  <li><a class="underlined" href="misc.xhtml">Other tools included in the package</a></li>
  <li><a class="underlined" href="benchmark.xhtml">Benchmark results</a></li>
  <li><a class="underlined" href="additional.xhtml">Additional notes</a></li>
</ul>

<h2 id="introduction">Introduction</h2>

<p class="noindent">
  SLEEF includes a quad-precision math library. This library includes
  various functions for computing with
  <a class="underlined"
  href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">IEEE
  754 quadruple-precision(QP) floating-point numbers</a>. If the
  compiler natively supports IEEE 754 QP FP type, numbers in this
  natively supported QP data type can be directly passed to the
  library functions. Otherwise, the library defines a data type for
  retaining numbers in IEEE 754 QP data type.
</p>

<p>
  Many of the functions are fully vectorized to maximize the
  throughput of computation. For these functions, two vector registers
  are combined to retain a vector of QP FP numbers, where one of these
  registers holds the upper part of QP numbers, and the other register
  holds the lower part. Dedicated functions are provided to load to or
  store from variables in vector QP data types.
</p>


<h2 id="datatypes">Data types</h2>

<p class="funcname"><b class="type">Sleef_quad</b></p>

<p class="header">Description</p>

<p class="noindent">
  <b class="type">Sleef_quad</b> is a data type for retaining a single
  QP FP number. If the compiler natively supports IEEE 754 quad
  precision FP type, then <b class="type">Sleef_quad</b> is an alias of
  that data type.
</p>

<pre class="white">typedef __float128 Sleef_quad;</pre>
<pre class="white">typedef long double Sleef_quad;    // On AArch64 and System/390 systems</pre>

<p class="noindent">
  Otherwise, the library defines a 128-bit data type for retaining a number in
  IEEE 754 QP data format.
</p>


<h2 id="macro">Convenience function, macro and constants</h2>

<p class="funcname"><b id="sleef_q" class="func">sleef_q</b> - Function to define any QP FP constant</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b id="sleef_q" class="func">sleef_q</b>( <b class="type">int64_t</b> <i class="var">upper</i>, <b class="type">uint64_t</b> <i class="var">lower</i>, <b class="type">int</b> <i class="var">e</i> );<br/>
<br/>
</p>

<p class="header">Description</p>

<p class="noindent">
  This is a function for defining any QP FP constant. This function
  can be used to represent a QP FP constant on compilers without
  support for a QP FP data type. This function is small and thus the
  code is likely be optimized so that the immediate QP FP value is
  available at runtime. You can convert any QP FP value to this
  representation using <b>qutil</b> utility program.
</p>

<hr/>

<p class="funcname"><b id="SLEEF_QUAD_C" class="func">SLEEF_QUAD_C</b> - Macro for appending the correct suffix to a QP FP literal</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b id="SLEEF_QUAD_C" class="func">SLEEF_QUAD_C</b>( <i>literal</i> );<br/>
<br/>
</p>

<p class="header">Description</p>

<p class="noindent">
  This is a macro for appending the correct suffix to a QP FP
  literal. The data type for representing a QP FP number is not
  available on all systems, and the data type differs between
  architectures. This macro can be used to append the correct suffix
  regardless of the architecture. This macro is defined only if the
  compiler supports a data type for representing a QP FP number.
</p>

<hr/>

<p class="header">Constants</p>

<p class="noindent">
Below is the table of QP constants defined in sleefquad.h. These are
also defined in the inline headers. These constants are defined as QP
literals if the compiler supports them. Otherwise, they are defined
with <b id="sleef_q" class="func">sleef_q</b> function.
</p>

<br/>

<table style="text-align:center;" align="center">
  <tr align="center">
    <td>
      <table class="lt">
        <tr>
          <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
          <td class="lt-hl"></td>
        </tr>
	<tr>
	  <td class="lt-br">Symbol</td>
	  <td class="lt-br">Meaning</td>
	  <td class="lt-bl">Value</td>
	</tr>
        <tr>
          <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
        </tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_Eq</td>
	  <td class="lt-r" align="left">The base <i>e</i> of natural logarithm</td>
	  <td class="lt-l" align="left">2.7182818284590452353...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_LOG2Eq</td>
	  <td class="lt-r" align="left">The logarithm to base 2 of <i>e</i></td>
	  <td class="lt-l" align="left">1.4426950408889634073...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_LOG10Eq</td>
	  <td class="lt-r" align="left">The logarithm to base 10 of <i>e</i></td>
	  <td class="lt-l" align="left">0.4342944819032518276...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_LN2q</td>
	  <td class="lt-r" align="left">The natural logarithm of 2</td>
	  <td class="lt-l" align="left">0.6931471805599453094...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_LN10q</td>
	  <td class="lt-r" align="left">The natural logarithm of 10</td>
	  <td class="lt-l" align="left">2.3025850929940456840...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_PIq</td>
	  <td class="lt-r" align="left">&pi;, the ratio of a circle’s circumference to its diameter</td>
	  <td class="lt-l" align="left">3.1415926535897932384...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_PI_2q</td>
	  <td class="lt-r" align="left">&pi; divided by two</td>
	  <td class="lt-l" align="left">1.5707963267948966192...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_PI_4q</td>
	  <td class="lt-r" align="left">&pi; divided by four</td>
	  <td class="lt-l" align="left">0.7853981633974483096...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_1_PIq</td>
	  <td class="lt-r" align="left">1/&pi;, the receiprocal of &pi;</td>
	  <td class="lt-l" align="left">0.3183098861837906715...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_2_PIq</td>
	  <td class="lt-r" align="left">2/&pi;, two times the receiprocal of &pi;</td>
	  <td class="lt-l" align="left">0.6366197723675813430...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_2_SQRTPIq</td>
	  <td class="lt-r" align="left">Two times the reciprocal of the square root of &pi;</td>
	  <td class="lt-l" align="left">1.1283791670955125738...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_SQRT2q</td>
	  <td class="lt-r" align="left">The square root of two</td>
	  <td class="lt-l" align="left">1.4142135623730950488...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_SQRT3q</td>
	  <td class="lt-r" align="left">The square root of three</td>
	  <td class="lt-l" align="left">1.7320508075688772935...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_INV_SQRT3q</td>
	  <td class="lt-r" align="left">The reciprocal of the square root of three</td>
	  <td class="lt-l" align="left">0.5773502691896257645...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_SQRT1_2q</td>
	  <td class="lt-r" align="left">The reciprocal of the square root of two</td>
	  <td class="lt-l" align="left">0.7071067811865475244...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_INV_SQRTPIq</td>
	  <td class="lt-r" align="left">The reciprocal of the square root of &pi;</td>
	  <td class="lt-l" align="left">0.5641895835477562869...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_EGAMMAq</td>
	  <td class="lt-r" align="left">The Euler-Mascheroni constant</td>
	  <td class="lt-l" align="left">0.5772156649015328606...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_M_PHIq</td>
	  <td class="lt-r" align="left">The golden ratio constant</td>
	  <td class="lt-l" align="left">1.6180339887498948482...</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_QUAD_MAX</td>
	  <td class="lt-r" align="left">The largest finite QP FP number</td>
	  <td class="lt-l" align="left">2<sup>16383</sup> &times; (2 - 2<sup>-112</sup>) = 1.18973... &times; 10<sup>4932</sup></td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_QUAD_MIN</td>
	  <td class="lt-r" align="left">The smallest positive normal QP FP number</td>
	  <td class="lt-l" align="left">2<sup>-16382</sup> &times; (1 - 2<sup>-112</sup>) = 3.36210... &times; 10<sup>-4932</sup></td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">SLEEF_QUAD_EPSILON</td>
	  <td class="lt-r" align="left">The difference between 1 and the least QP FP number greater than 1</td>
	  <td class="lt-l" align="left">2<sup>-112</sup> = 1.92592... &times; 10<sup>-34</sup></td>
	</tr>
	<tr>
	  <td class="lt-br" align="left">SLEEF_QUAD_DENORM_MIN</td>
	  <td class="lt-br" align="left">The smallest positive QP FP number</td>
	  <td class="lt-bl" align="left">2<sup>-16494</sup> = 6.47517... &times; 10<sup>-4966</sup></td>
	</tr>
      </table>
    </td>
  </tr>
</table>


<h2 id="conversion">Conversion and output functions</h2>

<p class="funcname"><b id="Sleef_strtoq" class="func">Sleef_strtoq</b> - convert ASCII string to QP FP number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_strtoq</b>( <b class="type">const char *</b> <i class="var">str</i>, <b class="type">char **</b> <i class="var">endptr</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  This is a QP version of the strtod function. It converts the given
  string to a QP FP number. It supports converting from both decimal
  and hexadecimal numbers.
</p>

<hr/>

<p class="funcname"><b id="Sleef_printf" class="func">Sleef_printf</b>, <b id="Sleef_fprintf" class="func">Sleef_fprintf</b>, <b id="Sleef_snprintf" class="func">Sleef_snprintf</b>, <b id="Sleef_vprintf" class="func">Sleef_vprintf</b>, <b id="Sleef_vfprintf" class="func">Sleef_vfprintf</b>, <b id="Sleef_vsnprintf" class="func">Sleef_vsnprintf</b> - Format various data into string and output</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int</b> <b class="func">Sleef_printf</b>( <b class="type">const char *</b> <i class="var">fmt</i>, ... );<br/>
<b class="type">int</b> <b class="func">Sleef_fprintf</b>( <b class="type">FILE *</b> <i class="var">fp</i>, <b class="type">const char *</b> <i class="var">fmt</i>, ... );<br/>
<b class="type">int</b> <b class="func">Sleef_snprintf</b>( <b class="type">char *</b> <i class="var">str</i>, <b class="type">size_t</b> <i class="var">size</i>, <b class="type">const char *</b> <i class="var">fmt</i>, ... );<br/>
<b class="type">int</b> <b class="func">Sleef_vprintf</b>( <b class="type">const char *</b> <i class="var">fmt</i>, <b class="type">va_list</b> <i class="var">ap</i> );<br/>
<b class="type">int</b> <b class="func">Sleef_vfprintf</b>( <b class="type">FILE *</b> <i class="var">fp</i>, <b class="type">const char *</b> <i class="var">fmt</i>, <b class="type">va_list</b> <i class="var">ap</i> );<br/>
<b class="type">int</b> <b class="func">Sleef_vsnprintf</b>( <b class="type">char *</b> <i class="var">str</i>, <b class="type">size_t</b> <i class="var">size</i>, <b class="type">const char *</b> <i class="var">fmt</i>, <b class="type">va_list</b> <i class="var">ap</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions are equivalent to the
  corresponding <b class="func">printf</b> functions in the C
  standard, except for the following extensions. These functions
  support converting from QP FP numbers using <b>Q</b> and <b>P</b>
  modifiers with <b>a</b>, <b>e</b>, <b>f</b> and <b>g</b>
  conversions. With <b>Q</b> modifier, an immediate QP FP value can be
  passed to these functions, while a QP FP value can be passed via a
  pointer with <b>P</b> modifier. These functions only supports the
  format strings defined in the C standard. Beware
  of <a class="underlined"
  href="https://bugs.llvm.org/show_bug.cgi?id=47665">this bug</a> when
  you use this function with clang. These functions are neither
  thread safe nor atomic.
</p>

<hr/>

<p class="funcname"><b id="Sleef_cast_to_doubleq1" class="func">Sleef_cast_to_doubleq1</b>, <b id="Sleef_cast_to_doubleq1_purec" class="func">Sleef_cast_to_doubleq1_purec</b>, <b id="Sleef_cast_to_doubleq1_purecfma" class="func">Sleef_cast_to_doubleq1_purecfma</b> - Convert QP number to double-precision number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">double</b> <b class="func">Sleef_cast_to_doubleq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">double</b> <b class="func">Sleef_cast_to_doubleq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">double</b> <b class="func">Sleef_cast_to_doubleq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a QP FP value to a double-precision value.
</p>

<hr/>

<p class="funcname"><b id="Sleef_cast_from_doubleq1" class="func">Sleef_cast_from_doubleq1</b>, <b id="Sleef_cast_from_doubleq1_purec" class="func">Sleef_cast_from_doubleq1_purec</b>, <b id="Sleef_cast_from_doubleq1_purecfma" class="func">Sleef_cast_from_doubleq1_purecfma</b> - Convert double-precision number to QP number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_doubleq1</b>( <b class="type">double</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_doubleq1_purec</b>( <b class="type">double</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_doubleq1_purecfma</b>( <b class="type">double</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a double-precision value to a QP FP value.
</p>

<hr/>


<p class="funcname"><b id="Sleef_cast_to_int64q1" class="func">Sleef_cast_to_int64q1</b>, <b id="Sleef_cast_to_int64q1_purec" class="func">Sleef_cast_to_int64q1_purec</b>, <b id="Sleef_cast_to_int64q1_purecfma" class="func">Sleef_cast_to_int64q1_purecfma</b> - Convert QP number to 64-bit signed integer</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int64_t</b> <b class="func">Sleef_cast_to_int64q1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">int64_t</b> <b class="func">Sleef_cast_to_int64q1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">int64_t</b> <b class="func">Sleef_cast_to_int64q1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a QP FP value to a 64-bit signed integer.
</p>

<hr/>


<p class="funcname"><b id="Sleef_cast_from_int64q1" class="func">Sleef_cast_from_int64q1</b>, <b id="Sleef_cast_from_int64q1_purec" class="func">Sleef_cast_from_int64q1_purec</b>, <b id="Sleef_cast_from_int64q1_purecfma" class="func">Sleef_cast_from_int64q1_purecfma</b> - Convert 64-bit signed integer to QP number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_int64q1</b>( <b class="type">int64_t</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_int64q1_purec</b>( <b class="type">int64_t</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_int64q1_purecfma</b>( <b class="type">int64_t</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a 64-bit signed integer to a QP FP value.
</p>

<hr/>


<p class="funcname"><b id="Sleef_cast_to_uint64q1" class="func">Sleef_cast_to_uint64q1</b>, <b id="Sleef_cast_to_uint64q1_purec" class="func">Sleef_cast_to_uint64q1_purec</b>, <b id="Sleef_cast_to_uint64q1_purecfma" class="func">Sleef_cast_to_uint64q1_purecfma</b> - Convert QP number to 64-bit unsigned integer</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">uint64_t</b> <b class="func">Sleef_cast_to_uint64q1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">uint64_t</b> <b class="func">Sleef_cast_to_uint64q1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">uint64_t</b> <b class="func">Sleef_cast_to_uint64q1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a QP FP value to a 64-bit signed integer.
</p>

<hr/>


<p class="funcname"><b id="Sleef_cast_from_uint64q1" class="func">Sleef_cast_from_uint64q1</b>, <b id="Sleef_cast_from_uint64q1_purec" class="func">Sleef_cast_from_uint64q1_purec</b>, <b id="Sleef_cast_from_uint64q1_purecfma" class="func">Sleef_cast_from_uint64q1_purecfma</b> - Convert 64-bit unsigned integer to QP number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_uint64q1</b>( <b class="type">uint64_t</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_uint64q1_purec</b>( <b class="type">uint64_t</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cast_from_uint64q1_purecfma</b>( <b class="type">uint64_t</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions convert a 64-bit unsigned integer to a QP FP value.
</p>


<h2 id="comparison">Comparison functions</h2>

<p class="funcname" id="basicComparison">QP comparison functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpltq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpleq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgtq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgeq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpeqq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpneq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpltq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpleq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgtq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgeq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpeqq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpneq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpltq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpleq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgtq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpgeq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpeqq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpneq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions compare two QP FP
  values. The <b>lt</b>, <b>le</b>, <b>gt</b>, <b>ge</b>, <b>eq</b>
  and <b>ne</b> functions return 1 if and only if <i class="var">a</i>
  is less than, less or equal, greather than, greater or equal, equal
  and not equal to <i class="var">b</i>, respectively. Otherwise, 0 is
  returned.
</p>

<hr/>

<p class="funcname"><b id="Sleef_icmpq1" class="func">Sleef_icmpq1</b>, <b id="Sleef_icmpq1_purec" class="func">Sleef_icmpq1_purec</b>, <b id="Sleef_icmpq1_purecfma" class="func">Sleef_icmpq1_purecfma</b> - QP comparison</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_icmpq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions compare two QP FP values. If <i class="var">a</i> is
  greater than <i class="var">b</i>, they return
  1. If <i class="var">a</i> is less than <i class="var">b</i>, they
  return -1. Otherwise, they return 0. If either argument is NaN, they
  return 0.
</p>

<hr/>

<p class="funcname"><b id="Sleef_iunordq1" class="func">Sleef_iunordq1</b>, <b id="Sleef_iunordq1_purec" class="func">Sleef_iunordq1_purec</b>, <b id="Sleef_iunordq1_purecfma" class="func">Sleef_iunordq1_purecfma</b> - Check orderedness</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int32_t</b> <b class="func">Sleef_iunordq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_iunordq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">int32_t</b> <b class="func">Sleef_iunordq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return 1 if either argument is NaN, otherwise 0.
</p>


<h2 id="mathfunctions">Math functions</h2>

<p id="basicArithmetic" class="funcname">QP functions for basic arithmetic operations</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_addq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_subq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_mulq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_divq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_negq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_addq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_subq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_mulq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_divq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_negq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_addq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_subq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_mulq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_divq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_negq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  The add, sub, mul and div functions perform addition, subtraction,
  multiplication and division of two QP FP values. The error bound of
  these functions are 0.5000000001 ULP. The neg functions return
  -<i class="var">a</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_sqrtq1_u05" class="func">Sleef_sqrtq1_u05</b>, <b id="Sleef_sqrtq1_u05purec" class="func">Sleef_sqrtq1_u05purec</b>, <b id="Sleef_sqrtq1_u05purecfma" class="func">Sleef_sqrtq1_u05purecfma</b> - square root functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sqrtq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sqrtq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sqrtq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return nonnegative square root of a value
  in <i class="var">a</i>. The error bound of the returned value is
  0.5000000001 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_sinq1_u10" class="func">Sleef_sinq1_u10</b>, <b id="Sleef_sinq1_u10purec" class="func">Sleef_sinq1_u10purec</b>, <b id="Sleef_sinq1_u10purecfma" class="func">Sleef_sinq1_u10purecfma</b> - sine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the sine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_cosq1_u10" class="func">Sleef_cosq1_u10</b>, <b id="Sleef_cosq1_u10purec" class="func">Sleef_cosq1_u10purec</b>, <b id="Sleef_cosq1_u10purecfma" class="func">Sleef_cosq1_u10purecfma</b> - cosine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cosq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cosq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_cosq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the cosine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_tanq1_u10" class="func">Sleef_tanq1_u10</b>, <b id="Sleef_tanq1_u10purec" class="func">Sleef_tanq1_u10purec</b>, <b id="Sleef_tanq1_u10purecfma" class="func">Sleef_tanq1_u10purecfma</b> - tangent functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the tangent function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_asinq1_u10" class="func">Sleef_asinq1_u10</b>, <b id="Sleef_asinq1_u10purec" class="func">Sleef_asinq1_u10purec</b>, <b id="Sleef_asinq1_u10purecfma" class="func">Sleef_asinq1_u10purecfma</b> - arc sine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the arc sine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_acosq1_u10" class="func">Sleef_acosq1_u10</b>, <b id="Sleef_acosq1_u10purec" class="func">Sleef_acosq1_u10purec</b>, <b id="Sleef_acosq1_u10purecfma" class="func">Sleef_acosq1_u10purecfma</b> - arc cosine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acosq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acosq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acosq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the arc cosine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_atanq1_u10" class="func">Sleef_atanq1_u10</b>, <b id="Sleef_atanq1_u10purec" class="func">Sleef_atanq1_u10purec</b>, <b id="Sleef_atanq1_u10purecfma" class="func">Sleef_atanq1_u10purecfma</b> - arc tangent functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the arc tangent function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_atan2q1_u10" class="func">Sleef_atan2q1_u10</b>, <b id="Sleef_atan2q1_u10purec" class="func">Sleef_atan2q1_u10purec</b>, <b id="Sleef_atan2q1_u10purecfma" class="func">Sleef_atan2q1_u10purecfma</b> - arc tangent functions of two variables</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atan2q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atan2q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atan2q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the arc tangent function of
  ( <i class="var">y</i> / <i class="var">x</i> ).  The quadrant of
  the result is determined according to the signs
  of <i class="var">x</i> and <i class="var">y</i>. The error bound of
  the returned value is 1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_expq1_u10" class="func">Sleef_expq1_u10</b>, <b id="Sleef_expq1_u10purec" class="func">Sleef_expq1_u10purec</b>, <b id="Sleef_expq1_u10purecfma" class="func">Sleef_expq1_u10purecfma</b> - base-<i>e</i> exponential functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the value of <i>e</i> raised
  to <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_exp2q1_u10" class="func">Sleef_exp2q1_u10</b>, <b id="Sleef_exp2q1_u10purec" class="func">Sleef_exp2q1_u10purec</b>, <b id="Sleef_exp2q1_u10purecfma" class="func">Sleef_exp2q1_u10purecfma</b> - base-2 exponential functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp2q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp2q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp2q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return 2 raised to <i class="var">a</i>. The error
  bound of the returned value is 1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_exp10q1_u10" class="func">Sleef_exp10q1_u10</b>, <b id="Sleef_exp10q1_u10purec" class="func">Sleef_exp10q1_u10purec</b>, <b id="Sleef_exp10q1_u10purecfma" class="func">Sleef_exp10q1_u10purecfma</b> - base-10 exponentail</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp10q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp10q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_exp10q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return 10 raised to <i class="var">a</i>. The error
  bound of the returned value is 1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_expm1q1_u10" class="func">Sleef_expm1q1_u10</b>, <b id="Sleef_expm1q1_u10purec" class="func">Sleef_expm1q1_u10purec</b>, <b id="Sleef_expm1q1_u10purecfma" class="func">Sleef_expm1q1_u10purecfma</b> - base-<i>e</i> exponential functions minus 1</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expm1q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expm1q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_expm1q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the value one less than <i>e</i> raised
  to <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_logq1_u10" class="func">Sleef_logq1_u10</b>, <b id="Sleef_logq1_u10purec" class="func">Sleef_logq1_u10purec</b>, <b id="Sleef_logq1_u10purecfma" class="func">Sleef_logq1_u10purecfma</b> - natural logarithmic functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_logq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_logq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_logq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the natural logarithm
  of <i class="var">a</i>.  The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_log2q1_u10" class="func">Sleef_log2q1_u10</b>, <b id="Sleef_log2q1_u10purec" class="func">Sleef_log2q1_u10purec</b>, <b id="Sleef_log2q1_u10purecfma" class="func">Sleef_log2q1_u10purecfma</b> - base-2 logarithmic functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log2q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log2q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log2q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the base-2 logarithm
  of <i class="var">a</i>.  The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_log10q1_u10" class="func">Sleef_log10q1_u10</b>, <b id="Sleef_log10q1_u10purec" class="func">Sleef_log10q1_u10purec</b>, <b id="Sleef_log10q1_u10purecfma" class="func">Sleef_log10q1_u10purecfma</b> - base-10 logarithmic functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log10q1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log10q1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log10q1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the base-10 logarithm
  of <i class="var">a</i>.  The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_log1pq1_u10" class="func">Sleef_log1pq1_u10</b>, <b id="Sleef_log1pq1_u10purec" class="func">Sleef_log1pq1_u10purec</b>, <b id="Sleef_log1pq1_u10purecfma" class="func">Sleef_log1pq1_u10purecfma</b> - logarithm of one plus argument</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log1pq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log1pq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_log1pq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the natural logarithm of
  ( 1 + <i class="var">a</i> ).  The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_powq1_u10" class="func">Sleef_powq1_u10</b>, <b id="Sleef_powq1_u10purec" class="func">Sleef_powq1_u10purec</b>, <b id="Sleef_powq1_u10purecfma" class="func">Sleef_powq1_u10purecfma</b> - power functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_powq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_powq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_powq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions return the value of <i class="var">x</i> raised to the power
  of <i class="var">y</i>. The error bound of the returned value is 1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_sinhq1_u10" class="func">Sleef_sinhq1_u10</b>, <b id="Sleef_sinhq1_u10purec" class="func">Sleef_sinhq1_u10purec</b>, <b id="Sleef_sinhq1_u10purecfma" class="func">Sleef_sinhq1_u10purecfma</b> - hyperbolic sine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinhq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinhq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_sinhq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the hyperbolic sine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_coshq1_u10" class="func">Sleef_coshq1_u10</b>, <b id="Sleef_coshq1_u10purec" class="func">Sleef_coshq1_u10purec</b>, <b id="Sleef_coshq1_u10purecfma" class="func">Sleef_coshq1_u10purecfma</b> - hyperbolic cosine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_coshq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_coshq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_coshq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the hyperbolic cosine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_tanhq1_u10" class="func">Sleef_tanhq1_u10</b>, <b id="Sleef_tanhq1_u10purec" class="func">Sleef_tanhq1_u10purec</b>, <b id="Sleef_tanhq1_u10purecfma" class="func">Sleef_tanhq1_u10purecfma</b> - hyperbolic tangent functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanhq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanhq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_tanhq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the hyperbolic tangent function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_asinhq1_u10" class="func">Sleef_asinhq1_u10</b>, <b id="Sleef_asinhq1_u10purec" class="func">Sleef_asinhq1_u10purec</b>, <b id="Sleef_asinhq1_u10purecfma" class="func">Sleef_asinhq1_u10purecfma</b> - inverse hyperbolic sine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinhq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinhq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_asinhq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the inverse hyperbolic sine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_acoshq1_u10" class="func">Sleef_acoshq1_u10</b>, <b id="Sleef_acoshq1_u10purec" class="func">Sleef_acoshq1_u10purec</b>, <b id="Sleef_acoshq1_u10purecfma" class="func">Sleef_acoshq1_u10purecfma</b> - inverse hyperbolic cosine functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acoshq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acoshq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_acoshq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the inverse hyperbolic cosine function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_atanhq1_u10" class="func">Sleef_atanhq1_u10</b>, <b id="Sleef_atanhq1_u10purec" class="func">Sleef_atanhq1_u10purec</b>, <b id="Sleef_atanhq1_u10purecfma" class="func">Sleef_atanhq1_u10purecfma</b> - inverse hyperbolic tangent functions</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanhq1_u10</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanhq1_u10purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_atanhq1_u10purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
  These functions evaluate the inverse hyperbolic tangent function of a value
  in <i class="var">a</i>. The error bound of the returned value is
  1.0 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_truncq1" class="func">Sleef_truncq1</b>, <b id="Sleef_truncq1_purec" class="func">Sleef_truncq1_purec</b>, <b id="Sleef_truncq1_purecfma" class="func">Sleef_truncq1_purecfma</b> - round to integer towards zero</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_truncq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_truncq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_truncq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions round their argument to the integer value, in floating
format, nearest to but no larger in magnitude than the argument.
</p>

<hr/>

<p class="funcname"><b id="Sleef_floorq1" class="func">Sleef_floorq1</b>, <b id="Sleef_floorq1_purec" class="func">Sleef_floorq1_purec</b>, <b id="Sleef_floorq1_purecfma" class="func">Sleef_floorq1_purecfma</b> - round to integer towards minus infinity</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_floorq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_floorq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_floorq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the largest integer value not greater
than <i class="var">a</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_ceilq1" class="func">Sleef_ceilq1</b>, <b id="Sleef_ceilq1_purec" class="func">Sleef_ceilq1_purec</b>, <b id="Sleef_ceilq1_purecfma" class="func">Sleef_ceilq1_purecfma</b> - round to integer towards plus infinity</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ceilq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ceilq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ceilq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the smallest integer value not less
than <i class="var">a</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_roundq1" class="func">Sleef_roundq1</b>, <b id="Sleef_roundq1_purec" class="func">Sleef_roundq1_purec</b>, <b id="Sleef_roundq1_purecfma" class="func">Sleef_roundq1_purecfma</b> - round to integer away from zero</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_roundq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_roundq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_roundq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions round their argument to the nearest integer value,
rounding halfway cases away from zero.
</p>

<hr/>

<p class="funcname"><b id="Sleef_rintq1" class="func">Sleef_rintq1</b>, <b id="Sleef_rintq1_purec" class="func">Sleef_rintq1_purec</b>, <b id="Sleef_rintq1_purecfma" class="func">Sleef_rintq1_purecfma</b> - round to integer, ties round to even</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_rintq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_rintq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_rintq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions round their argument to an integer value with the
round-to-even method.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fabsq1" class="func">Sleef_fabsq1</b>, <b id="Sleef_fabsq1_purec" class="func">Sleef_fabsq1_purec</b>, <b id="Sleef_fabsq1_purecfma" class="func">Sleef_fabsq1_purecfma</b> - absolute value</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fabsq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fabsq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fabsq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the absolute value of <i class="var">a</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_copysignq1" class="func">Sleef_copysignq1</b>, <b id="Sleef_copysignq1_purec" class="func">Sleef_copysignq1_purec</b>, <b id="Sleef_copysignq1_purecfma" class="func">Sleef_copysignq1_purecfma</b> - copy sign of a number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_copysignq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_copysignq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_copysignq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return a value with the magnitude
of <i class="var">a</i> and the sign of <i class="var">b</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fmaxq1" class="func">Sleef_fmaxq1</b>, <b id="Sleef_fmaxq1_purec" class="func">Sleef_fmaxq1_purec</b>, <b id="Sleef_fmaxq1_purecfma" class="func">Sleef_fmaxq1_purecfma</b> - maximum of two numbers</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaxq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaxq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaxq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the larger value of <i class="var">a</i>
and <i class="var">b</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fminq1" class="func">Sleef_fminq1</b>, <b id="Sleef_fminq1_purec" class="func">Sleef_fminq1_purec</b>, <b id="Sleef_fminq1_purecfma" class="func">Sleef_fminq1_purecfma</b> - minimum of two numbers</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fminq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fminq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fminq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the smaller value of <i class="var">a</i>
and <i class="var">b</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fdimq1_u05" class="func">Sleef_fdimq1_u05</b>, <b id="Sleef_fdimq1_u05purec" class="func">Sleef_fdimq1_u05purec</b>, <b id="Sleef_fdimq1_u05purecfma" class="func">Sleef_fdimq1_u05purecfma</b> - positive difference</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fdimq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fdimq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fdimq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad</b> <i class="var">b</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the positive difference
between <i class="var">a</i> and <i class="var">b</i>. The error bound
of these functions are 0.5000000001 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fmodq1" class="func">Sleef_fmodq1</b>, <b id="Sleef_fmodq1_purec" class="func">Sleef_fmodq1_purec</b>, <b id="Sleef_fmodq1_purecfma" class="func">Sleef_fmodq1_purecfma</b> - floating point remainder</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmodq1</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmodq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmodq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return <i class="var">x</i>
- <i>n</i> <i class="var">y</i>, where <i>n</i> is the quotient
of <i class="var">x</i> / <i class="var">y</i>, rounded toward zero to
an integer.
</p>

<hr/>

<p class="funcname"><b id="Sleef_remainderq1" class="func">Sleef_remainderq1</b>, <b id="Sleef_remainderq1_purec" class="func">Sleef_remainderq1_purec</b>, <b id="Sleef_remainderq1_purecfma" class="func">Sleef_remainderq1_purecfma</b> - floatint point remainder</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_remainderq1</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_remainderq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_remainderq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return <i class="var">x</i>
- <i>n</i> <i class="var">y</i>, where <i>n</i> is the quotient
of <i class="var">x</i> / <i class="var">y</i>, rounded to an integer
with the round-to-even method.
</p>

<hr/>

<p class="funcname"><b id="Sleef_frexpq1" class="func">Sleef_frexpq1</b>, <b id="Sleef_frexpq1_purec" class="func">Sleef_frexpq1_purec</b>, <b id="Sleef_frexpq1_purecfma" class="func">Sleef_frexpq1_purecfma</b> - split a number to fractional and integral components</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_frexpq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">int *</b> <i class="var">ptr</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_frexpq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">int *</b> <i class="var">ptr</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_frexpq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">int *</b> <i class="var">ptr</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions split the argument <i class="var">a</i> into a
fraction <i>f</i> and an exponent <i>e</i>, where 0.5 &le; <i>f</i>
&lt; 1 and <i class="var">a</i> = <i>f</i> 2<sup><i>e</i></sup>. The
computed exponent <i>e</i> will be stored in <i class="var">*ptr</i>,
and the functions return <i>f</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_modfq1" class="func">Sleef_modfq1</b>, <b id="Sleef_modfq1_purec" class="func">Sleef_modfq1_purec</b>, <b id="Sleef_modfq1_purecfma" class="func">Sleef_modfq1_purecfma</b> - break a number into integral and fractional parts</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_modfq1</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad *</b> <i class="var">ptr</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_modfq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad *</b> <i class="var">ptr</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_modfq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">a</i>, <b class="type">Sleef_quad *</b> <i class="var">ptr</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions split the argument <i class="var">a</i> into an
integral part <i>k</i> and a fractional part
<i>f</i>, where <i>k</i> and <i>f</i> have the same sign
as <i class="var">a</i>. <i>k</i> will be stored
in <i class="var">*ptr</i>, and the functions return <i>f</i>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_hypotq1_u05" class="func">Sleef_hypotq1_u05</b>, <b id="Sleef_hypotq1_u05purec" class="func">Sleef_hypotq1_u05purec</b>, <b id="Sleef_hypotq1_u05purecfma" class="func">Sleef_hypotq1_u05purecfma</b> - 2D Euclidian distance</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_hypotq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_hypotq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_hypotq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the square root of the sum of the squares
of <i class="var">x</i> and <i class="var">y</i>. The error bound of
these functions are 0.5000000001 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_fmaq1_u05" class="func">Sleef_fmaq1_u05</b>, <b id="Sleef_fmaq1_u05purec" class="func">Sleef_fmaq1_u05purec</b>, <b id="Sleef_fmaq1_u05purecfma" class="func">Sleef_fmaq1_u05purecfma</b> - fused multiply and accumulate</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaq1_u05</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">z</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaq1_u05purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">z</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_fmaq1_u05purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">Sleef_quad</b> <i class="var">y</i>, <b class="type">Sleef_quad</b> <i class="var">z</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return <i class="var">x</i><i class="var">y</i>
+ <i class="var">z</i> with a single rounding. The error bound of
these functions are 0.5000000001 ULP.
</p>

<hr/>

<p class="funcname"><b id="Sleef_ldexpq1" class="func">Sleef_ldexpq1</b>, <b id="Sleef_ldexpq1_purec" class="func">Sleef_ldexpq1_purec</b>, <b id="Sleef_ldexpq1_purecldexp" class="func">Sleef_ldexpq1_purecfma</b> - multiply by integral power of 2</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ldexpq1</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">int</b> <i class="var">e</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ldexpq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">int</b> <i class="var">e</i> );<br/>
<b class="type">Sleef_quad</b> <b class="func">Sleef_ldexpq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i>, <b class="type">int</b> <i class="var">e</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return <i class="var">x</i> 2<sup><i class="var">e</i></sup>.
</p>

<hr/>

<p class="funcname"><b id="Sleef_ilogbq1" class="func">Sleef_ilogbq1</b>, <b id="Sleef_ilogbq1_purec" class="func">Sleef_ilogbq1_purec</b>, <b id="Sleef_ilogbq1_purecilogb" class="func">Sleef_ilogbq1_purecfma</b> - integer exponent of an FP number</p>

<p class="header">Synopsis</p>

<p class="synopsis">
#include &lt;sleefquad.h&gt;<br/>
<br/>
<b class="type">int</b> <b class="func">Sleef_ilogbq1</b>( <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<b class="type">int</b> <b class="func">Sleef_ilogbq1_purec</b>( <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<b class="type">int</b> <b class="func">Sleef_ilogbq1_purecfma</b>( <b class="type">Sleef_quad</b> <i class="var">x</i> );<br/>
<br/>
<span class="normal">Link with</span> -lsleefquad -ltlfloat.
</p>

<p class="header">Description</p>

<p class="noindent">
These functions return the exponent
of <i class="var">x</i>. If <i class="var">x</i> is zero, infinite and
a NaN, they return <b>SLEEF_FP_ILOGB0</b>, <b>INT_MAX</b>
and <b>SLEEF_FP_ILOGBNAN</b>, respectively.
</p>


<h2 id="tutorial">Tutorial</h2>

<p class="noindent">
  I would like to show an example of how the vectorized QP functions
  can be used. Below is <a class="underlined" href="machinx86.c">a
  source code</a> for computing &pi; with <a class="underlined"
  href="https://en.wikipedia.org/wiki/Machin-like_formula">Machin's
  formula</a> on x86 GNU systems. This formula has two terms with arc
  tangent which can be independently calculated. In this example,
  these two terms are computed using vector
  functions. <b class="type">__float128</b> data type is defined on
  x86, and you can use literals in this type to initialize the
  variables. Variables <i class="var">q0</i>, <i class="var">q1</i>, <i class="var">q2</i>
  and <i class="var">q3</i> retain two QP FP values each. At line 5, 8
  and 11, QP values in arrays are loaded into these variables with
  <a href="quadx86.xhtml#load"><b class="func">Sleef_loadq2_sse2</b></a>
  function. Vector operations are carried out from line 14 to 16, and
  then each element of the vector variable <i class="var">q3</i> is
  extracted
  with <a href="quadx86.xhtml#get"><b class="func">Sleef_getq2_sse2</b></a>
  function and subtracted to obtain the result at line 18. Note that
  the QP subtract function in the standard library is called to do
  this subtraction.  This result is output to the console
  using <a href="#Sleef_printf"><b class="func">Sleef_printf</b></a>
  function at line 22. Note that this source code can be built with
  clang, on which libquadmath is not available.
</p>

<pre class="code">
<code>#include &lt;sleefquad.h&gt;</code>
<code></code>
<code>int main(int argc, char **argv) {</code>
<code>  __float128 a0[] = { 5, 239 };</code>
<code>  Sleef_quadx2 q0 = Sleef_loadq2_sse2(a0);</code>
<code></code>
<code>  __float128 a1[] = { 1, 1 };</code>
<code>  Sleef_quadx2 q1 = Sleef_loadq2_sse2(a1);</code>
<code></code>
<code>  __float128 a2[] = { 16, 4 };</code>
<code>  Sleef_quadx2 q2 = Sleef_loadq2_sse2(a2);</code>
<code></code>
<code>  Sleef_quadx2 q3;</code>
<code>  q3 = Sleef_divq2_u05sse2(q1, q0);</code>
<code>  q3 = Sleef_atanq2_u10sse2(q3);</code>
<code>  q3 = Sleef_mulq2_u05sse2(q3, q2);</code>
<code></code>
<code>  __float128 pi = Sleef_getq2_sse2(q3, 0) - Sleef_getq2_sse2(q3, 1);</code>
<code></code>
<code>  Sleef_printf("%.40Pg\n", &amp;pi);</code>
<code>}</code>
</pre>
<p style="text-align:center;">
  Fig. 4.1: <a class="underlined" href="machinx86.c">Example source code for x86 computers</a>
</p>

<br/>

<p>
  <b class="type">__float128</b> data type is not defined on MSVC, and
  thus we cannot use literals of this type to initialize QP
  variables. Sleef provides various conversion functions for this
  purpose. In <a class="underlined" href="machinx86.c">the following
  source
  code</a>, <a href="#Sleef_cast_from_doubleq1_purec"><b class="func">Sleef_cast_from_doubleq1_purec</b></a>
  function is used to initialize <i class="var">q0</i> from line 4 to
  5. <a href="#Sleef_strtoq"><b class="func">Sleef_strtoq</b></a>
  function is used to initialize <i class="var">q1</i> at line 7.
  Here, <a href="quadx86.xhtml#splat"><b class="func">Sleef_splatq2_sse2</b></a>
  function is a function for setting the specified QP FP value to all
  elements in a vector. Obtaining QP FP constants by calling these
  functions may waste some CPU time. From line 9 and
  12, <a href="#sleef_q"><b class="func">sleef_q</b></a> function is
  used to intialize
  <i class="var">q2</i>. <a href="#sleef_q"><b class="func">sleef_q</b></a>
  is a function for defining a QP FP constant. You can convert any QP
  FP value to this representation using <b>qutil</b> utility
  program. At line
  20, <a href="#basicArithmetic"><b class="func">Sleef_subq1_u05purec</b></a>
  function is used to subtract a scalar value from another to obtain
  the result.
</p>

<pre class="code">
<code>#include &lt;sleefquad.h&gt;</code>
<code></code>
<code>int main(int argc, char **argv) {</code>
<code>  Sleef_quad a0[] = { Sleef_cast_from_doubleq1_purec(5), Sleef_cast_from_doubleq1_purec(239) };</code>
<code>  Sleef_quadx2 q0 = Sleef_loadq2_sse2(a0);</code>
<code></code>
<code>  Sleef_quadx2 q1 = Sleef_splatq2_sse2(Sleef_strtoq("1.0", NULL));</code>
<code></code>
<code>  Sleef_quadx2 q2 = Sleef_loadq2_sse2((Sleef_quad[]) {</code>
<code>      sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, 4), // 16.0</code>
<code>      sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, 2), // 4.0</code>
<code>  });</code>
<code></code>
<code>  Sleef_quadx2 q3;</code>
<code></code>
<code>  q3 = Sleef_divq2_u05sse2(q1, q0);</code>
<code>  q3 = Sleef_atanq2_u10sse2(q3);</code>
<code>  q3 = Sleef_mulq2_u05sse2(q3, q2);</code>
<code></code>
<code>  Sleef_quad pi = Sleef_subq1_u05purec(Sleef_getq2_sse2(q3, 0), Sleef_getq2_sse2(q3, 1));</code>
<code></code>
<code>  Sleef_printf("%.40Pg\n", &amp;pi);</code>
<code>}</code>
</pre>
<p style="text-align:center;">
  Fig. 4.2: <a class="underlined" href="machinmsvc.c">Example source code for MSVC</a>
</p>


<p class="footer">
  Copyright &copy; 2010-2025 SLEEF Project, Naoki Shibata and contributors.<br/>
  SLEEF is open-source software and is distributed under the Boost Software License, Version 1.0.
</p>

<script type="text/javascript">
var sc_project=13098265; 
var sc_invisible=1; 
var sc_security="518de45e"; 
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async="async"></script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="https://c.statcounter.com/13098265/0/518de45e/1/"
alt="Web Analytics"
referrerPolicy="no-referrer-when-downgrade"></img></a></div></noscript>


</body>
</html>
